<template>
    <div>
        <div class="blog-up">
            <p class="blog-up-name">平滑滚动</p>
        </div>
        <div class="read-content">
            <div class="read-left">
                <h3><span>文章目录</span><i class="el-icon-close"></i></h3>
                <!-- <a href="#" name="top"></a> -->
                <ul>
                     <li class="star"><i class="el-icon-star-off"></i>&nbsp;&nbsp;<a href="#first">前言</a></li>
                    <li class="star"><i class="el-icon-star-off"></i>&nbsp;&nbsp;<a href="#use">使用插件</a></li>
                </ul>
                <!-- <p><a href="#book">随笔</a></p>
                <p><a href="#think">感悟</a></p>
                <p><a href="#phone">联系方式</a></p> -->
               
            </div>
            <div class="read-right">
                <h1>平滑滚动</h1>
                <div class="times"><i class="el-icon-time">2020年9月25日</i><i class="el-icon-chat-dot-round" style="margin-left: 30px;">0</i></div>
                <div class="thinks">
                    <h3><a name="first">前言</a></h3>
                    <p>之前给自己的博客中回到顶部功能主要用的setTimeout延时滚动，看到vue文档中点击对应标题，就可以平滑滚动到锚点，就很好奇是怎么实现的，看了一下网页的源码，发现是使用了一个叫做smooth-scroll的轻量插件，所以自己也鼓捣使用了这个插件，把原本用setTimeout回到顶部的功能也直接用这个插件实现。</p>
                </div>
                <div class="phones">
                    <h3><a name="use">使用插件</a></h3>
                    <ul>
                        <li>smooth-scroll</li>
                    </ul>
                </div>
                <div>
                    <Email></Email>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import Email from '@/components/email'

export default {
     name:'read',
    components:{
        Email
    }

}
</script>

<style scoped>
    *{
        margin: 0;
        padding: 0;
    }
    a{
        text-decoration: none;
        color: #fff;
    }
    /* li{
        list-style: none;
    } */
    .blog-up{
        background:url('../assets/sunset.jpg');
        height:570px;
        width:100%;
        background-size: 100% 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .blog-up-name{
        margin: 0;
        color: #fff;
        font-size: 45px;
        font-family: 'Times New Roman';
    }
    .read-content{
        display: flex;
        background-color: black;
        color: #fff;
    }
    .read-left{
        width: 300px;
        text-align: left;
        margin-left: 32px;
        margin: 40px 20px 20px 10px;
    }
    .read-left h3 span{
        margin-right: 20px;
    }
    .read-left ul{
        color: #fff;
        list-style: none;
    }
    .read-left ul li{
        margin-left: 20px;
        height: 30px;
        width: 190px;
    }
    .read-left ul li:first-child{
        margin-left:10px;
        margin-top: 10px;
    }
    .read-right{
        width: 800px;
        text-align: left;
    }
    .read-right h1{
        text-align: center;
        margin-top: 70px;
    }
    .times{
        text-align: right;
    }
    .books{
        font-size: 25px;
        font-weight: 600;
        border-bottom: 1px solid #fff;
        padding: 20px 0 10px 0;
    }
    .thinks{
        margin: 35px 0px 35px 0;
    }
    .thinks p{
        margin-top: 10px;
        color: #e3eaf1;
    }
    .phones li{
        margin-top: 15px;
    }
    .phones span{
        color: aquamarine;
    }
</style>